The present invention is situated within the field of organic colorants and relates to an improved process for preparing dioxazine compounds. Dioxazine compounds are used to prepare valuable dyes and pigments (see Ullmann""s Encyclopedia of Industrial Chemistry, Vol. A 3, p. 233). They are prepared industrially in a five-stage synthesis embracing the N-alkylation of carbazole, nitration, reduction, condensation and ring closure. In the final stage of the synthesis, compounds of the formula (II) 
are cyclized to the dioxazine compounds using ring closure agents, such as benzenesulfonyl chloride or 4-toluenesulfonyl chloride, for example (DE-A 30 10 949). High temperatures are needed for the ring closure. Consequently, the only suitable reaction media for the ring closure are inert solvents whose boiling point under atmospheric pressure is more than 160xc2x0 C. Proposed solvents of this type have included halogenated aromatic solvents, especially o-dichlorobenzene; nitrobenzene; polar aprotic solvents, such as quinoline; and halogenated monoalkyl-, dialkyl- and trialkylbenzenes, alkylnaphthalenes, and also alkanes and alkenes. Of these reaction media, the only one which has become established to date for the industrial preparation of dioxazine compounds is o-dichlorobenzene, since this solvent offers a number of advantages in both technical and economic respects. Significant advantages of o-dichlorobenzene are the high yields at all stages that can be achieved in this reaction medium, and also the easy phase separations and the resulting possibility of working without isolating the intermediates and without changing solvent. A procedure of this kind makes it possible to prepare the dioxazine compounds in a technically simple and economically advantageous way. Like other chlorinated aromatic solvents, however, o-dichlorobenzene has the disadvantage that the production wastewaters contain AOX and that, at the high reaction temperatures, toxic and environmentally harmful substances are formed in trace amounts, accumulate in the regenerated solvent in the production circuit and can also be detected in the product.
As environmental concerns acquired increasing importance therefore, a need came about for a preparation process which is advantageous to conduct over all stages of the synthesisxe2x80x94that is, which does not necessitate any isolation of intermediates or change of solventxe2x80x94but which, unlike that using o-dichlorobenzene, is environmentally unobjectionable.
The halogen-free reaction media proposed to date have disadvantages which hinder their use in an industrial process for preparing dioxazine compounds. Polar aprotic solvents such as quinoline and dimethylformamide (JP-A-56-135 556) differ from o-dichlorobenzene in being soluble in water and are unsuitable as reaction media for all reaction stages of the synthesis. In these solvents, furthermore, the synthesis cannot be carried out without isolation of intermediates. When these solvents are used, it is necessary to isolate the condensation product prior to the ring closure and to change the reaction medium to allow substantially anhydrous operation and to give acceptable yields. Consequently, preparing dioxazine compounds using these solvents is technically complex and uneconomical.
Monoalkyl-, dialkyl- and trialkylbenzenes and alkylnaphthalenes (JP-A-7-331 097) and also alkanes and alkenes (JP-A-7-331 098) likewise have disadvantages in respect of the technical and economic preparation of the dioxazine compounds. In the preliminary stages, for example, the poorer solubilities of the intermediates, byproducts and the chloranil in these solvents in comparison with o-dichlorobenzene makes it necessary to employ substantially larger reaction volumes. Furthermore, the phases have to be separated in relatively large vessels. This makes the space yields significantly poorer than when working in o-dichlorobenzene. Furthermore, the use of these solvents gives rise to phase separation problems, resulting in long preparation times and thus poor time yields. If the synthesis is carried out without isolation of intermediates, the poor solubility of the excess chloranil and of the byproducts accumulated at the end of the synthesis in these solvents is a further serious disadvantage. Furthermore, following the isolation of the dioxazine compounds by filtration, they have to be washed with an organic solvent having better solvency in order to free the product completely from the byproducts and the unreacted starting products, which otherwise impair the performance properties. The product crystals are usually substantially smaller and of inferior morphology than when o-dichlorobenzene is used as the reaction medium; for this reason, in the course of the necessary washing with the additional polar solvent, there may be a drastic deterioration in the filtration form. Operating with a second organic solvent, moreover, represents an additional technical expense. The ring closure yields achievable in these halogen-free solvents are only moderate. Because of these disadvantages, the above-proposed halogen-free solvents have also been unable to replace the o-dichlorobenzene which has been preferred to date for the industrial preparation of the dioxazine compounds.
It has now surprisingly been found that certain aryl alkyl ethers which boil above 160xc2x0 C. are especially suitable as a reaction medium for the complete synthesis of the dioxazine compounds.
The present invention accordingly provides a process for preparing dioxazines by ring closure of a compound of the formula (II) 
in which R1 is hydrogen or C1-C8 alkyl in the presence of a ring closure agent, which comprises using as reaction medium an aryl alkyl ether of the formula (Ill) or a mixture of aryl alkyl ethers of the formula (Ill) 
in which n is an integer from 0 to 2 and R2 is ethyl if n is 0 or is methyl if n is 1 or 2.
Preference is given to n =0 and R2=ethyl (phenetole), and to n=1 and R2=methyl. The methyl group is preferably positioned m or p with respect to the ether function. Particular preference is given to p-cresyl methyl ether (4-methylanisole).
C1-C8-alkyl R1 can be straight-chain or branched and can for example be methyl, ethyl, n-propyl, isopropyl, n-butyl, sec-butyl, isobutyl, tert.-butyl, pentyl, hexyl, heptyl or octyl. Preference is given to methyl, ethyl or propyl, especially ethyl.
The dioxazine compounds formed in the process of the invention can in principle possess a structure of the formula (a), (b) or (c) or can be a mixture of these compounds: 
The aryl alkyl ether is judiciously used in an amount of from 3 to 20 times, preferably from 5 to 15 times, the amount by weight of the compound of the formula (II).
Examples of ring closure agents which can be used in the process of the invention are benzenesulfonyl chloride, 4-toluenesulfonyl chloride, nitro- or chloro-substituted benzenesulfonyl chloride, chloranil and pyridine N-oxide. A preferred ring closure agent is benzenesulfonyl chloride or 4-toluenesulfonyl chloride.
Benzenesulfonyl chloride, or substituted benzenesulfonyl chloride, is used preferably in amounts of from 0.5 to 2.0 mol, with particular preference from 1.0 to 1.5 mol, per mole of compound of the formula (II). Pyridine N-oxide is added preferably in an amount of from 1 to 3 mol, in particular from 1.2 to 2.5 mol, per mole of compound of the formula (II). Chloranil is added preferably in an amount of from 5 to 50 mol %, in particular from 10 to 40 mol %, based on the compound of the formula (II).
The reaction temperature is judiciously situated within the range from 140 to 200xc2x0 C., preferably from 160 to 190xc2x0 C. The reaction can be carried out under atmospheric pressure, superatmospheric pressure or reduced pressure. Reaction under atmospheric pressure is preferred. The reaction generally takes from 1 to 10 hours. Preference is given to a reaction time of from 3 to 7 hours.
In order to prepare the dioxazine compounds in highly pure form it is sufficient to filter the hot reaction mixture from the ring closure, said mixture containing an aryl alkyl ether of the invention, and to wash the filtercake with preferably hot aryl alkyl ether. The pure product is obtained in a readily filterable form and a high yield.
For example, at the end of the reaction, the reaction mixture can be diluted with aryl alkyl ether and filtered while hot, preferably at from 100 to 150xc2x0 C. The resulting paste of crude product is washed with aryl alkyl ether, preferably hot, and then freed from the major amount of the adhering aryl alkyl ether by means, for example, of blowing with an inert gas. Residues of the aryl alkyl ether can be removed completely by means of steam distillation or drying. In order to remove the water-soluble byproducts, the product is generally also suspended in water, washed and dried.
The compounds of the formula (II) can also be prepared by condensing 3-amino-N-alkylcarbazoles of the formula (IV) 
in which R1 is as defined above with chloranil in one or more of the aryl alkyl ethers of the invention and preferably in the presence of an acid-binding agent, such as sodium acetate, sodium hydrogencarbonate or sodium carbonate, for example. For the condensation with chloranil it is also possible to use a solution of the 3-amino-N-alkylcarbazole of the formula (IV) in the aryl alkyl ether, as obtained following reduction of the 3-nitro-N-alkylcarbazole in the aryl alkyl ether.
The compounds of the formula (II) obtained by this process can be reacted further in the form of the resulting suspension in the aryl alkyl ether, without isolation, to give the dioxazines.
The present invention therefore further provides a process for preparing dioxazines by condensing a 3-amino-N-alkylcarbazole of the formula (IV) 
in which R1 is hydrogen or C1-C8 alkyl in an aryl alkyl ether of the formula (III) with chloranil to give the compound of the formula (II), followed by ring closure in the presence of a ring closure agent to give a dioxazine. The ring closure agent used can be any of those mentioned above. The condensation step can be conducted at temperatures from 20 to 90xc2x0 C. The amount of chloranil is preferably from 0.6 to 0.9 mol per mole of 3-amino-N-alkylcarbazole used. Particular advantages are that there is no need to isolate the condensation product of the formula (II) and that all reaction steps can be carried out in the aryl alkyl ether of the invention.
The outstanding suitability of the aryl alkyl ethers for the synthesis of the dioxazine compounds was unforeseeable, since the aryl alkyl ethers are reactive compounds which are easily nitrated, for example, in the free o- or p-positions and/or are subject to ether cleavage in the presence of acids (cf., e.g., Beilstein, Volume 6, 3rd Supplement, p. 1385). It has surprisingly been found that under the nitration conditions, which result in a high yield of 3-nitro-N-alkylcarbazole, there is neither significant nitration of the aryl alkyl ether nor significant cleavage of the ether bond. Similarly, there is no significant ether cleavage of the aryl alkyl ethers of the invention in the course of the ring closure reaction brought about using acid-forming ring closure agents. In comparison with alkylbenzenes, alkylnaphthalenes, alkanes and alkenes, the aryl alkyl ethers of the invention possess good solvency for the starting materials, intermediates and byproducts of the synthesis, so that very good space-time yields are possible.